package com.mydomain.debtbook;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class Debtbook extends TabActivity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		Resources res = getResources(); // Resource object to get Drawables
		TabHost tabHost = getTabHost(); // The activity TabHost
		TabHost.TabSpec spec; // Resusable TabSpec for each tab
		Intent intent; // Reusable Intent for each tab

		// Do the same for the other tabs
		intent = new Intent().setClass(getBaseContext(), ProfileActivity.class);
		spec = tabHost
				.newTabSpec("new")
				.setIndicator("Profile",
						res.getDrawable(R.drawable.ic_tab_profile))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent()
				.setClass(getBaseContext(), ViewDebtActivity.class);
		spec = tabHost
				.newTabSpec("settings")
				.setIndicator("Group", res.getDrawable(R.drawable.ic_tab_group))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent()
				.setClass(getBaseContext(), ResolveActivity.class);
		spec = tabHost
				.newTabSpec("resolve")
				.setIndicator("Resolve",
						res.getDrawable(R.drawable.ic_tab_resolve))
				.setContent(intent);
		tabHost.addTab(spec);

		tabHost.setCurrentTab(2);
	}
}
